<div class="d-flex align-items-center login-content">
    <form [formGroup]="myForm">
        <h3 class="d-flex justify-content-center">用户登录</h3>
        <p *ngIf="myForm.invalid" class="text-danger">表单无效！</p>
        <div class="form-group">
            <label for="userName">用户名</label>
            <input type="text" class="form-control" id="userName" aria-describedby="输入用户名" name="userName"
                formControlName="userName" [ngClass]="{'is-invalid':userName.invalid, 'is-valid':
          userName.valid}">
            <div class="valid-feedback">
                用户名格式正确！
            </div>
            <div class="invalid-feedback">
                <span *ngIf="userName.hasError('required')">用户名长度必须大于7位！</span>
                <span *ngIf="userName.hasError('pattern')">用户名必须以“zime”开头！</span>
            </div>
        </div>
        <div class="form-group">
            <label for="password">Password</label>
            <input type="password" class="form-control" id="password" name="password" formControlName="password"
                [ngClass]="{'is-invalid':password.invalid, 'is-valid':password.valid}">
            <div class="valid-feedback">
                密码填写正确！
            </div>
            <div class="invalid-feedback">
                密码长度必须大于6位！
            </div>
        </div>
        <button type="submit" class="btn btn-primary btn-block" [routerLink]="['/management']" (click)='login()'>
            登录</button>
        <!-- <button type="submit" class="btn btn-primary btn-block" [routerLink]="['/management']>提交</button> -->
    </form>
</div>



<!-- <div class="d-flex align-items-center container">
    <div class="row clearfix" style="margin: 120px 0 0 0 ;">
        <div class="col-md-1 column">
        </div>
        <div class="col-md-5 column">
            <h3>
                登录
            </h3>
            <h6>
                没有账号？点击此处
                <a routerLink="/register-demo" routerLinkActive="activebutton">注册</a>
            </h6>
            <form [formGroup]="formGroup" (ngSubmit)="onSubmit()">
                <div class="form-group">
                    <label for="username">Username</label><input type="username" class="form-control" id="username"
                        formControlName="username" />
                </div>
                <div class="form-group">
                    <label for="password">Password</label><input type="password" class="form-control" id="password"
                        formControlName="password" />
                </div>

                <div class="checkbox">
                    <label><input type="checkbox" />记住账号</label>
                    <label><input type="checkbox" />自动登录</label>
                </div>
                <button type="submit" class="btn btn-success" [routerLink]="['/management']" (click)='login()>Submit</button>
                <div class="form-group ">
                    <div class="col-sm-offset-2 col-sm-10 ">
                    </div>
                </div>
            </form>
        </div>
    </div>
</div> -->